package com.sourcetrip.binarytree;


import com.sourcetrip.raw.adt.MyRedBlackTree;
import com.sourcetrip.utils.printer.BinaryTrees;

/**
 * @author: ZhouBert
 * @date: 2020/12/4
 * @description:
 * 红黑树是为了提高搜索效率的
 */
public class MyRBTreeTest01 {

	public static void main(String[] args) {
		testAdd();
	}

	static void testAdd(){
		Integer data[] = new Integer[]{
				67, 52, 92, 96, 53, 95, 13, 63, 34, 82, 76, 54, 9, 68, 39
		};
		MyRedBlackTree<Integer> rbt = new MyRedBlackTree<>();
		for (int i = 0; i < data.length; i++) {
			rbt.add(data[i]);
			System.out.println("【" + data[i] + "】");
			BinaryTrees.println(rbt);
			System.out.println("---------------------------------------");
		}

		BinaryTrees.println(rbt);
	}
}
